
import hibernatetable.HIBERNATETABLE;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.classic.Session;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author zafiron
 */
public class hibernateTest {
    
    public static void main(String args[])
    {
    HIBERNATETABLE test = new HIBERNATETABLE();
    test.setUserName("Luis");
    test.setId(1);
    SessionFactory sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
    Session session = sessionFactory.openSession();  
    session.beginTransaction();
    session.save(test);
    session.getTransaction().commit();
    }
}
